<!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <title>以下实例在屏幕可视窗口尺寸小于 600 像素时将 div 元素隐藏：</title>
    <style>
        div.example {
            background-color: yellow;
            padding: 20px;
        }

        @media screen and (max-width: 600px) {
            div.example {
                display: none;
            }
        }
    </style>
</head>

<body>

    <h2>屏幕可视尺寸小于 600 px 时，隐藏以下元素。</h2>

    <div class="example">我是会隐藏的元素。</div>

    <p>重置浏览器大小，查看效果。</p>

</body>

</html>